<div class="container-fluid" style="padding: 20px 10px 0px 10px">
	<div class="row-fluid">
		<div class="well">
		    <ul class="nav nav-tabs">
		      <li class="active"><b>分类设置</b></li>
		    </ul>
		    <div id="myTabContent" class="tab-content">
				<div class="tab-pane active in" id="home">
					<form id="formid" action="/cate/addcate" method="post">
						<p>分类名称：<input type="text" value="<?=$cateRow['cate_name']?>" name="catename" style="width:191px" type='text' class="">
						分类名称：<select name="cateid" style="width:106px" <?=!$cateRow['parent_id'] && I('get.cateid') ? 'disabled' : ''?>>
							<option value='0'>顶级分类</option>
							<?php if($cateEntity){foreach($cateEntity AS $key=>$val){?>
							<option value='<?=$val["key"]?>' <?=$val['key']==$cateRow['parent_id'] ? 'selected="selected"' : ''?>><?=$val['name']?></option>
							<?php if($val['sons']){foreach($val['sons'] AS $vs){?>
							<option value='<?=$vs["key"]?>' <?=$vs['key']==$cateRow['parent_id'] ? 'selected="selected"' : ''?>>&nbsp;&nbsp;└ <?=$vs['name']?></option>
							<?php }}?>
							<?php }}?>
						</select>
						排序值：<input type="text" name="sort" placeholder="排序值" value="<?=$cateRow['sort']?>" style="width:92px" />
 						<p><div id="setImd" style="display:inline">分类图片：<input type="text" name="logo_url" class="setImdText" style="width:388px" value="<?=$cateRow['logo_url']?>" readonly> <input type="button" class="btn btn-info setImdBtn" style='margin-top:-8px' value="选择图片">&nbsp;<a class="btn btn-warning  picViews" <?=$cateRow['logo_url'] ? '' : 'disabled title="暂不可用"'?> url="<?=$cateRow['logo_url'] ? transUrl($cateRow['logo_url']) : ''?>" style='margin-top:-8px'>查看</a></div>
 						</p><p><div id="setImd1" style="display:inline">推广图片：<input type="text" name="spread_pic" class="setImd1Text" style="width:388px" value="<?=$cateRow['spread_pic']?>" readonly> <input type="button" class="btn btn-info setImd1Btn" style='margin-top:-8px' value="选择图片">&nbsp;<a class="btn btn-warning  picViews" <?=$cateRow['spread_pic'] ? '' : 'disabled title="暂不可用"'?> url="<?=$cateRow['spread_pic'] ? transUrl($cateRow['spread_pic']) : ''?>" style='margin-top:-8px'>查看</a></div>
 						</p>
 						<p>推广标题：<input type="text" name="spread_name" placeholder="推广标题" value="<?=$cateRow['spread_name']?>" style="width:290px" />
 							&nbsp;&nbsp;推广开关：<label style="display:inline"><input style="margin-top:1px" type="radio" name="spread_status" value="1" <?=$cateRow['spread_status'] == '1' ? 'checked="checked"' : ''?> /> 开</label> &nbsp;
 							<label style="display:inline"><input style="margin-top:1px" type="radio" name="spread_status" value="0" <?=$cateRow['spread_status'] == '0' ? 'checked="checked"' : ''?> /> 关</label>
 						</p>
						
						<input type="hidden" value="1" name="dosubmit" />
						<input type="hidden" value="<?=$cateRow['cate_id']?>" name="cate_id" />
					</form>
				</div>
				<div class="btn-toolbar">
				    <button class="btn btn-primary" id="btn-save" style="margin-left:72px;margin-top:20px"><i class="icon-save"></i> 保存</button>
				  <div class="btn-group">
				  </div>
				</div>
			</div>
		</div>
	</div>
</div>
<script id="slideId" type="text/html">
<select id="setSele" name="slide_id" style="width:105px;margin-left:4px">
<?php if($slides){foreach($slides AS $vals){?>
<option value="<?=$vals['slide_id']?>" <?=$cateRow['slide_id'] == $vals['slide_id'] ? 'selected="selected"' : ''?>><?=$vals['title']?></option>
<?php }}?>
</select>
</script>
<script>
$(function(){
	$('.setImdBtn').click(function(){
		$('#setImd').selfups();
	});
	$('.setImd1Btn').click(function(){
		$('#setImd1').selfups();
	});
	$('#btn-save').click(function(){
		if($('input[name="catename"]').val() == ''){
			showmsg('分类名称不能为空！');
		}else{
			setBtn($('#btn-save'));
			$('#formid').submit();
		}
	});
	$('#slide_id').change(function(){
		_this = $(this);
		if(_this.val() > 0){
			$($('#slideId').html()).insertAfter(_this);
		}else{
			$('#setSele').remove();
		}
	}).trigger('change');
})
</script>